<?php $this->load->view('admin/public/head.html'); ?>
<!-- Content Wrapper. Contains page content -->
<div class="content-wrapper" ng-controller="admin-home-index">
    <!-- Main content -->
    <section class="content">

        <div class="row">
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-aqua"><i class="fa fa-file-text-o"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text">订单总数</span>
                        <a href="/order/lists/index" class="info-box-number" ng-bind="summary.total.order"></a>
                        <br>
                        <span class="info-box-text" style="font-size: 12px;" ng-bind="'今日: ' + summary.today.order"></span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
            <!-- /.col -->
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-green"><i class="fa fa-apple"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text">APP安装</span>
                        <a href="/goods/lists/index" class="info-box-number" ng-bind="summary.total.install"></a>
                        <br>
                        <span class="info-box-text" style="font-size: 12px;" ng-bind="'今日: ' + summary.today.install"></span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
            <!-- /.col -->
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-yellow"><i class="fa fa-users"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text">注册会员</span>
                        <a href="/user/lists/index" class="info-box-number" ng-bind="summary.total.user"></a>
                        <br>
                        <span class="info-box-text" style="font-size: 12px;" ng-bind="'今日: ' + summary.today.user"></span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
            <!-- /.col -->
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-red"><i class="fa fa-rss"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text">发帖总数</span>
                        <a href="/bbs/lists/index" class="info-box-number" ng-bind="summary.total.bbs"></a>
                        <br>
                        <span style="font-size: 12px;" class="info-box-text" ng-bind="'今日: ' + summary.today.bbs"></span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->

        <div class="row">
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-purple"><i class="fa fa-tree"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text">基地总数</span>
                        <span class="info-box-number" ng-bind="summary.total.base"></span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
            <!-- /.col -->
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-maroon"><i class="fa fa-cart-plus"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text">商品总数</span>
                        <span class="info-box-number" ng-bind="summary.total.product"></span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
            <!-- /.col -->
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-navy"><i class="fa fa-eye"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text">今日PV</span>
                        <span class="info-box-number" ng-bind="summary.total.pv"></span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
            <!-- /.col -->
            <div class="col-md-3 col-sm-6 col-xs-12">
                <div class="info-box">
                    <span class="info-box-icon bg-teal"><i class="fa fa-hourglass-start"></i></span>

                    <div class="info-box-content">
                        <span class="info-box-text">今日启动</span>
                        <span class="info-box-number" ng-bind="summary.total.startup"></span>
                    </div>
                    <!-- /.info-box-content -->
                </div>
                <!-- /.info-box -->
            </div>
            <!-- /.col -->
        </div>
        <!-- /.row -->

        <div class="row">
            <div class="col-md-12">
                <!-- BAR CHART -->
                <div class="box box-success">
                    <div class="box-header with-border">
                        <h3 class="box-title">流量统计</h3>
                    </div>
                    <div class="box-body">
                        <div class="chart">
                            <canvas id="barChart" style="height:230px"></canvas>
                        </div>
                    </div>
                    <!-- /.box-body -->
                </div>
                <!-- /.box -->
            </div>
        </div>

        <!-- Main row -->
        <div class="row">
            <!-- Left col -->
            <div class="col-md-8">
                <div class="row">
                    <div class="col-md-12">
                        <div class="box box-info">
                            <div class="box-header with-border">
                                <h3 class="box-title">客户端安装</h3>
                            </div>
                            <div class="box-body">
                                <div class="chart">
                                    <canvas id="lineChart" style="height:250px"></canvas>
                                </div>
                            </div>
                            <!-- /.box-body -->
                        </div>
                    </div>

                    <div class="col-md-6">
                     <!-- USERS LIST -->
                        <div class="box box-danger">
                    <div class="box-header with-border">
                        <h3 class="box-title">最新会员</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body no-padding">
                        <ul class="users-list clearfix">
                            <li ng-repeat="u in latestUsers">
                                <img ng-src="{{ u.avatar ? u.avatar : '/assets/admin/img/head.png' }}" onerror="this.src='/assets/admin/img/head.png'" alt="User Image">
                                <a class="users-list-name" href="#" ng-bind="u.nickName"></a>
                                <span class="users-list-date" ng-bind="u.created"></span>
                            </li>
                        </ul>
                        <!-- /.users-list -->
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer text-center">
                        <a href="/user/lists/index" class="uppercase">查看更多</a>
                    </div>
                    <!-- /.box-footer -->
                </div>
                        <!--/.box -->
                    </div>
                    <!-- /.col -->

                    <div class="col-md-6">
                        <!-- PRODUCT LIST -->
                        <div class="box box-primary">
                            <div class="box-header with-border">
                                <h3 class="box-title">最新农场</h3>
                            </div>
                            <!-- /.box-header -->
                            <div class="box-body">
                                <ul class="products-list product-list-in-box">
                                    <li class="item" ng-repeat="b in latestBases">
                                        <div class="product-img">
                                            <img ng-src="{{ b.thumb }}" alt="{{b.name}}" onerror="this.src='/assets/admin/img/nothumb.png'">
                                        </div>
                                        <div class="product-info">
                                            <a href="javascript:void(0)" class="product-title" ng-bind="b.name"></a>
                                            <span class="product-description" ng-bind="(b.charger || '') + ' - ' + b.address "></span>
                                        </div>
                                    </li>
                                    <!-- /.item -->
                                </ul>
                            </div>
                            <!-- /.box-body -->
                            <div class="box-footer text-center">
                                <a href="/farm/base/index" class="uppercase">查看更多</a>
                            </div>
                            <!-- /.box-footer -->
                        </div>
                        <!-- /.box -->
                    </div>
                 </div>
                <!-- /.row -->

                <!-- TABLE: LATEST ORDERS -->
                <div class="box box-info">
                    <div class="box-header with-border">
                        <h3 class="box-title">最新订单</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <div class="table-responsive">
                            <table class="table no-margin">
                                <thead>
                                <tr>
                                    <th>订单编号 ID</th>
                                    <th>用户昵称</th>
                                    <th>交易金额</th>
                                    <th>订单状态</th>
                                    <th>下单时间</th>
                                </tr>
                                </thead>
                                <tbody>
                                <tr ng-repeat="o in latestOrders">
                                    <td><a href="pages/examples/invoice.html" ng-bind="o.sn"></a></td>
                                    <td ng-bind="o.nickName"></td>
                                    <td class="text-danger" ng-bind="'￥' + o.totalPrice"></td>
                                    <td>
                                        <span class="label"
                                              ng-class="{
                                                'label-success': o.status == 'Complete',
                                                'label-info': o.status == 'Unpaid' || o.status == 'Pending' || o.status == 'Dispatch',
                                                'label-warning': o.status == 'Refund' || o.status == 'Refunded',
                                                'label-default' : o.status == 'Cancel'
                                              }"
                                              ng-bind="o.formatStatus"></span>
                                    </td>
                                    <td>
                                        <div class="sparkbar" data-color="#00a65a" data-height="20" ng-bind="o.created"></div>
                                    </td>
                                </tr>
                                </tbody>
                            </table>
                        </div>
                        <!-- /.table-responsive -->
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer clearfix text-center">
                        <a href="/order/lists/index" class="uppercase">查看更多</a>
                    </div>
                    <!-- /.box-footer -->
                </div>
                <!-- /.box -->
            </div>

            <div class="col-md-4">

                <div class="box box-default">
                    <div class="box-header with-border">
                        <h3 class="box-title">用户来源</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <div class="row">
                            <div class="col-md-8">
                                <div class="chart-responsive">
                                    <canvas id="pieChart" height="150"></canvas>
                                </div>
                                <!-- ./chart-responsive -->
                            </div>
                            <!-- /.col -->
                            <div class="col-md-4">
                                <ul class="chart-legend clearfix">
                                    <li><i class="fa fa-circle-o text-red"></i> 微信</li>
                                    <li><i class="fa fa-circle-o text-green"></i> IOS</li>
                                    <li><i class="fa fa-circle-o text-yellow"></i> 安卓</li>
                                </ul>
                            </div>
                            <!-- /.col -->
                        </div>
                        <!-- /.row -->
                    </div>
                </div>
                <!-- /.box -->

                <!-- PRODUCT LIST -->
                <div class="box box-success">
                    <div class="box-header with-border">
                        <h3 class="box-title">最新产品</h3>
                    </div>
                    <!-- /.box-header -->
                    <div class="box-body">
                        <ul class="products-list product-list-in-box">
                            <li class="item" ng-repeat="g in latestProducts">
                                <div class="product-img">
                                    <img ng-src="{{ g.thumb }}" alt="{{ g.goodsName }}" onerror="this.src='/assets/admin/img/nothumb.png'">
                                </div>
                                <div class="product-info">
                                    <a href="javascript:void(0)" class="product-title">
                                        <span ng-bind="g.goodsName"></span>
                                        <span class="label label-warning pull-right" ng-bind="'￥' + g.price"></span></a>
                                    <span class="product-description" ng-bind="g.description"></span>
                                </div>
                            </li>
                        </ul>
                    </div>
                    <!-- /.box-body -->
                    <div class="box-footer text-center">
                        <a href="/goods/lists/index" class="uppercase">查看更多</a>
                    </div>
                    <!-- /.box-footer -->
                </div>
                <!-- /.box -->
            </div>
        </div>
    </section>
    <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<?php $this->load->view('admin/public/foot.html', array(
    'js' => array(
        "https://cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js",
        '/assets/library/plugins/chartjs/Chart.min.js',
        'assets/admin/js/home/index.js'
    )
));
?>
